project(
    'demo',
    'fortran',
    'c',
    version : '0.1.0',
    license : 'All rights reserved',
    meson_version : '>= 0.60.0',
    default_options : [
        'buildtype=debugoptimized',
    ],
)

# 源代码
deps_src = files(
    'build/dependencies/seakeeping/src/seakeeping_linalg.F90',
    'build/dependencies/seakeeping/src/seakeeping_kinds.F90',
)

demo_src = files(
    'src/say_hello.c',
)

# 中间链接库
deps_lib = library(
    'seakeeping',
    deps_src,
    dependencies : [
        dependency('openblas'),
    ],
    install : true,
)

demo_lib = library(
    'demo',
    demo_src,
    link_with : [
        deps_lib,
    ],
    install : true,
)

# 可执行程序
executable(
    'demo',
    'app/main.f90',
    link_with : [
        deps_lib,
        demo_lib,
    ],
    # 使用 OpenMP 的方式，此处暂时注释掉
    #dependencies : [
    #    dependency('openmp'),
    #],
    install : true,
)
